<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
 <head>
  <title>选择用户列表</title>
  <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  <script type="text/javascript">
	  var company;
	  $(document).ready(function(){
		  $.ajax({
			  url:"businessOrderController.do?getDeptList",
			  type:"GET",
			  dataType:"JSON",
			  async: false,
			  success:function(data){
				  if(data.success){

					  var dept = data.attributes.dept;
					  var top;
					  if(dept.length > 0){
						  for(var i=0;i<dept.length;i++){
							  var opt = new Option(dept[i].name,dept[i].code);
							  document.getElementById('sysOrgCode').options.add(opt);
							  if(i==0){
								  top = dept[i].code;
							  }
						  }
					  }
					  company = data.attributes.comp;
					  if(company.length > 0){
						  for(var i=0;i<company.length;i++){
							  if(top == company[i].parentCode){
								  var opt = new Option(company[i].name,company[i].code);
								  document.getElementById('sysCompanyCode').options.add(opt);
							  }
						  }
					  }
				  }
			  }
		  });
	  });
	  function changeOrgCode(parentCode){
		  document.getElementById('sysCompanyCode').length = 0;
		  if(company.length > 0){
			  for(var i=0;i<company.length;i++){
				  if(parentCode == company[i].parentCode){
					  var opt = new Option(company[i].name,company[i].code);
					  document.getElementById('sysCompanyCode').options.add(opt);
				  }
			  }
		  }
	  }
  </script>
 </head>
 <body>
  <t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" action="businessUserMapController.do?doAdd" >
					<input id="id" name="id" type="hidden" value="${businessUserMapPage.id }"/>
		<table style="width: 600px;" cellpadding="0" cellspacing="1" class="formtable">
				<tr>
					<td align="right">
						<label class="Validform_label">
							频道:
						</label>
					</td>
					<td class="value">
						<select name="sysOrgCode" onchange="changeOrgCode(this.value)" id="sysOrgCode" class="form-control" ></select>
						 <span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">频道</label>
						</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							栏目:
						</label>
					</td>
					<td class="value">
						<select name="sysCompanyCode" id="sysCompanyCode" class="form-control" ></select>

							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">栏目</label>
						</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							用户姓名:
						</label>
					</td>
					<td class="value">
					     	 <input id="userName" name="userName" type="text" maxlength="100" style="width: 150px" class="inputxt"  ignore="ignore" />
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">用户姓名</label>
						</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							汇款地址/账号:
						</label>
					</td>
					<td class="value">
					     	 <input id="costAddr" name="costAddr" type="text" maxlength="500" style="width: 150px" class="inputxt"  ignore="ignore" />
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">汇款地址/账号</label>
						</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							身份证号:
						</label>
					</td>
					<td class="value">
					     	 <input id="userCard" name="userCard" type="text" maxlength="100" style="width: 150px" class="inputxt"  ignore="ignore" />
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">卡号</label>
						</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							备注:
						</label>
					</td>
					<td class="value">
					     	 <input id="remark" name="remark" type="text" maxlength="100" style="width: 150px" class="inputxt"  ignore="ignore" />
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">备注</label>
						</td>
				</tr>
				
				
			</table>
		</t:formvalid>
 </body>
